package com.laou.demo;

import com.laou.demo.bean.Resume;
import com.laou.demo.repository.ResumeRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class MymongoApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext applicationContext = SpringApplication.run(MymongoApplication.class, args);

        ResumeRepository resumeRepository = applicationContext.getBean(ResumeRepository.class);
        /* System.out.println(resumeRepository.findAll());
        System.out.println(resumeRepository.findByNameEquals("zhangsan"));
        System.out.println(resumeRepository.findByNameAndExpectSalary("zhangsan",25000)); */
        Resume resume  = new Resume();
        resume.setName("孙悟空222");
        resume.setExpectSalary(1);
        resume.setCity("花果山222");
        resumeRepository.save(resume);
        System.out.println(resumeRepository.findAll());

    }

}
